package com.chong.activiti.service;

import com.chong.activiti.model.Activiti;
import com.chong.activiti.model.ActivitiTask;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;

import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;

/**
 * @author chong
 * @create 2020/6/4
 * Desc:
 */

public interface ActivitiService {
    /**
     * 获取仓库服务 ：管理流程定义
     * @param resource
     * @param name
     * @param categoryName
     */
    void deploy(String resource,String name,String categoryName);

    Task initiationProcess();

    Task startActiviti(Activiti vac, String tempName,Map<String,Object> map);

    List<Activiti> myActiviti(String userName);

    /**
     * 启动流程
     * @param perid
     * @param tempName
     * @param map
     * @return
     */
    ProcessInstance getTask(String perid, String tempName, Map<String, Object> map);


    List<ActivitiTask> myApproval(String userName);

    Boolean passApproval(String userName, ActivitiTask activitiTask);

    List<Activiti> myActivitiRecord(String userName);

    List<Activiti> myApprovalRecord(String userName);

    void tracePhoto(String processDefinitionId, OutputStream outputStream);

}
